package vn.com.bookstore.model;

import java.util.ArrayList;
import java.util.List;

import vn.com.bookstore.ObjectStore.Temp;
import android.util.Log;

import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;

public class ListPage {
	public ArrayList<Page> page;

	public static List<Page> parseListGson(String json) {
		Log.e("___ListPage", "____khac.pvan: " + json);
		Gson gson = new Gson();
		try {
			ListPage obj = gson.fromJson(json, ListPage.class);
			return obj.page;
		} catch (JsonSyntaxException e) {
			try {
				Temp obj2 = gson.fromJson(json, Temp.class);
				ArrayList<Page> result = new ArrayList<Page>();
				result.add(obj2.page);
				return result;
			} catch (Exception er) {
				return new ArrayList<Page>();
			}
		} catch (Exception e) {
			return new ArrayList<Page>();
		}
	}

}
